import request from '@/utils/request'
import store from '@/store/index'

export function adminStatistic() {
  return request({
    url: '/count/sum/all'
  })
}

export function ageStatisticByCampus(campusId) {
  return request({
    url: '/count/count/cam/age',
    method: 'get',
    params: {
      camId: campusId
    }
  })
}

export function eduStatisticByCampus(campusId) {
  return request({
    url: '/count/count/cam/edu',
    method: 'get',
    params: {
      camId: campusId
    }
  })
}

export function orderStatisticByCampus(campusId) {
  return request({
    url: '/count/Campus/allMoney',
    method: 'get',
    params: {
      camId: campusId
    }
  })
}

export function allOrderStatisticByRecommend() {
  return request({
    url: '/count/referenceId/allOrders',
    method: 'get',
    params: {
      referenceId: store.getters.token
    }
  })
}

export function directOrderStatisticByRecommend() {
  return request({
    url: '/count/referenceId/allNoStageOrders',
    method: 'get',
    params: {
      referenceId: store.getters.token
    }
  })
}

export function stageOrderStatisticByRecommend() {
  return request({
    url: '/count/referenceId/allStageOrders',
    method: 'get',
    params: {
      referenceId: store.getters.token
    }
  })
}

export function shareRatio() {
  return request({
    url: '/count/countMoney/All/shareRatio',
    method: 'get',
    params: {
      referenceId: store.getters.token
    }
  })
}

export function referenceRatio() {
  return request({
    url: '/count/countMoney/referenceRatio',
    method: 'get',
    params: {
      referenceId: store.getters.token
    }
  })
}

export function conditionSearch() {
  return request({
    url: '/count/countMoney/referenceRatio',
    method: 'get',
    params: {
      referenceId: store.getters.token
    }
  })
}

export function chart(campusId, orgId, timetype) {
  return request({
    url: '/count/chart/count',
    method: 'get',
    params: {
      campusId: campusId,
      orgId: orgId,
      timetype: timetype
    }
  })
}

export function chartSearch(campusId, orgId, searchdate, timetype, minAge, maxAge, minprice, maxprice, paytype, countType, countId) {
  return request({
    url: '/count/chart/count',
    method: 'get',
    params: {
      campusId: campusId,
      orgId: orgId,
      searchdate: searchdate,
      timetype: timetype,
      minAge: minAge,
      maxAge: maxAge,
      minprice: minprice,
      maxprice: maxprice,
      paytype: paytype,
      countType: countType,
      countId: countId
    }
  })
}

export function slsectReferenceId() {
  return request({
    url: '/organization/referenceId',
    method: 'get',
    params: {
      referenceId: store.getters.token
    }
  })
}

export function getOrgCount(orgName) {
  return request({
    url: '/count/orgCount',
    method: 'get',
    params: {
      orgName: orgName
    }
  })
}

export function getOrgMoney(orgId) {
  return request({
    url: '/count/countMoney/one/shareRatio',
    method: 'get',
    params: {
      orgId: orgId
    }
  })
}

export function getOrgUser(id) {
  return request({
    url: '/organization/server/head',
    method: 'get',
    params: {
      orgHead: store.getters.token
    }
  })
}

export function selectCampusByorgId(orgId) {
  return request({
    url: '/campus/orgId',
    method: 'get',
    params: {
      orgId: orgId
    }
  })
}

export function countReBusiness(date1, date2) {
  return request({
    url: '/count/consoleUser/coutorder',
    method: 'get',
    params: {
      date1: date1,
      date2: date2,
      userid: store.getters.token
    }
  })
}

export function countReBusiness2(date1, date2) {
  return request({
    url: '/count/consoleUser/coutorder2',
    method: 'get',
    params: {
      date1: date1,
      date2: date2,
      userid: store.getters.token
    }
  })
}

export function countBusiness(date1, date2) {
  return request({
    url: '/count/allconsoleUser/coutorder',
    method: 'get',
    params: {
      date1: date1,
      date2: date2
    }
  })
}

export function countBusiness2(date1, date2) {
  return request({
    url: '/count/allconsoleUser/coutorder2',
    method: 'get',
    params: {
      date1: date1,
      date2: date2
    }
  })
}

export function countZhixiaBusiness(date1, date2) {
  return request({
    url: '/count/zhixiaconsoleUser/coutorder',
    method: 'get',
    params: {
      date1: date1,
      date2: date2,
      userid: store.getters.token
    }
  })
}

export function countZhixiaBusiness2(date1, date2) {
  return request({
    url: '/count/zhixiaconsoleUser/coutorder2',
    method: 'get',
    params: {
      date1: date1,
      date2: date2,
      userid: store.getters.token
    }
  })
}

export function countFinance(timeType, date) {
  return request({
    url: '/count/countFinance',
    method: 'get',
    params: {
      date1: date,
      timeType: timeType
    }
  })
}
